package com.verisette.ncos.persistence.dao;

import java.util.List;

import org.corp.agi.persistence.dao.CommonDAOImpl;

import com.verisette.ncos.persistence.domain.CustomMasterUserGroup;

/**
 * {Description here}
 *
 * @author Thippawan Muangchu (Tip)
 * @since Oct 6, 2010 4:46:59 PM
 * @version 1.0.0
 * @see 
 */
public class UserAccessLogDAOImpl extends CommonDAOImpl  implements UserAccessLogDAO {

	@Override
	public List<CustomMasterUserGroup> listUserGroupByUser(String uspId) {
		StringBuilder sb = new StringBuilder();
		sb.append("SELECT MASTER_USER_PROFILE.USP_USER_NAME,");
		sb.append(" MASTER_USER_PROFILE.USP_ID,");
		sb.append(" MASTER_USER_USG_TO_USP.USG_ID,");
		sb.append(" MASTER_USER_GROUP.USG_NAME,");
		sb.append(" MASTER_USER_GROUP.USG_STATUS");
		sb.append(" FROM MASTER_USER_USG_TO_USP");
		sb.append(" INNER JOIN MASTER_USER_PROFILE ON MASTER_USER_USG_TO_USP.USP_ID = MASTER_USER_PROFILE.USP_ID");
		sb.append(" INNER JOIN MASTER_USER_GROUP ON MASTER_USER_USG_TO_USP.USG_ID = MASTER_USER_GROUP.USG_ID");
		sb.append(" WHERE (MASTER_USER_PROFILE.USP_ID = ?)");
		return (List<CustomMasterUserGroup>) nativeQuery(sb.toString(), CustomMasterUserGroup.class, uspId);
	}

}
